Speed up page insertion
authorPaolo Borelli <pborelli@gnome.org>
Sun, 26 Jun 2011 18:41:21 +0000 (20:41 +0200)
committerPaolo Borelli <pborelli@gnome.org>
Sun, 26 Jun 2011 18:41:21 +0000 (20:41 +0200)
Make sure to call widget_set_child_visible(false) on all tabs except the
current before calling widget_set_parent.

gtk/gtknotebook.c

index 7b44f82655a6255a3ef454d5b329b182335eba51..5bf3de5b6bcc33924e851f82f8324b7e09d706ce 100644 (file)
@@ -4560,6 +4560,10 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
     gtk_notebook_menu_item_create (notebook,
                                    g_list_find (priv->children, page));
 
+  /* child visible will be turned on by switch_page below */
+  if (priv->cur_page != page)
+    gtk_widget_set_child_visible (child, FALSE);
+
   gtk_widget_set_parent (child, GTK_WIDGET (notebook));
   if (tab_label)
     gtk_widget_set_parent (tab_label, GTK_WIDGET (notebook));
@@ -4569,10 +4573,6 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
   if (!priv->first_tab)
     priv->first_tab = priv->children;
 
-  /* child visible will be turned on by switch_page below */
-  if (priv->cur_page != page)
-    gtk_widget_set_child_visible (child, FALSE);
-
   if (tab_label)
     {
       if (priv->show_tabs && gtk_widget_get_visible (child))